<!-- /* Description for file.
 * 简历分类检索
 *
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/candidates
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0716
 * @lastmodified  张海杰2011年0716
 */-->
 
 <script language="javascript">
var delurl="<?php echo $deleteurl; ?>";
</script>
<script language="javascript">
var editurl="<?php echo $editurl; ?>";
</script>
<script language="javascript">
var addurl="<?php echo $addurl; ?>";
</script>
<script language="javascript">
var data=<?php echo $data; ?>;
</script>
<script language="javascript">
var disbutton=<?php echo $javascript->object($disbutton);?>;
</script>
<script language="javascript">
var title2="<?php echo $title2; ?>";
</script>
<?php echo $javascript->link('jquery-1.4.2');?>
<script language="javascript">
function button(com,grid,url)  
{  
	var ids=$("#flex").getCheckedRows();
	if(com=="delete")
	{
		var pids="";
		if(ids.length==0)
		{
			alert("请选择你要删除的项");
			return;
		}
		for(i=0;i<ids.length;i++)
        {
        	pids=pids+ids[i]+"/";
        }

		$.ajax({
            type: "post",
            url: url,
            data: {id:pids},
            dataType:"json",
            success: function(data) {
            $(".clearckeck").trigger("click");
			$(".pReload").trigger("click");
			$(".notice").html(data.message); 
			},
            error: function(data) {
				$(".clearckeck").trigger("click");
				$(".pReload").trigger("click");
				$(".notice").html('data.message');
			}
        });
	}
	else if(com=="add")
	{
		window.open(url);
	}
	else if(com=="edit")
	{
		if(ids.length!=1)
		{
			alert("请选择一个选项");
		}
		else
		{
			var seid=ids[0];
			var eurl=url+"?id="+seid;
			window.open(eurl);
		}
	}
	else
	{
		var pix=com.substring(0,2);
		switch (pix)
		{
			case "aj":
				var pids="";
				if(ids.length==0&&com.substring(0,3)!="ajj")
				{
					alert("请选择选项");
					return;
				}
				for(i=0;i<ids.length;i++)
		        {
		        	pids=pids+ids[i]+"/";
		        }
				$.ajax({
		           type: "post",
		           url: url,
		            data: {id:pids},
		            dataType:"json",
		            success: function(data) {
					$(".pReload").trigger("click");
					$(".notice").html(data.message); 
					},
		            error: function(data) {
						$(".clearckeck").trigger("click");
						$(".pReload").trigger("click");
						$(".notice").html('data.message');
					}
		        });
				break;
			case "up":
				if(ids.length!=1)
				{
					alert("请选择一个选项");
				}
				else
				{
					var seid=ids[0];
					var eurl=url+"?ids="+seid;
					window.open(eurl);
				}
				break;
			case "uu":
				if(ids.length!=1)
				{
					alert("请选择一个选项");
				}
				else
				{
					var seid=ids[0];
					var eurl=url+"/"+seid;
					window.open(eurl);
				}
				break;
			case "dp":
				pids="";
				if(ids.length<1)
				{
					alert("请选择你要添加的项");
				}
				else
				{
					for(i=0;i<ids.length;i++)
			        {
			        	pids=pids+ids[i]+"/";
			        }	
				}
				var param= [{name:"id",value:pids}];
				  $.ajax({
					  type: 'POST',
					   url: url,
					   async: false,
					   data: param,
					   dataType:"xml",
					   success: function(xml)
					   {	
					   }
					 });
				  window.opener.parent.location.reload();
				  //window.opener.tablereload("");
				  window.close();
				break;
			case "op":
				if(ids.length<1)
				{
					alert("请选择一个选项");
				}
				else
				{
					var pids="";
					for(i=0;i<ids.length;i++)
			        {
			        	pids=pids+ids[i]+"/";
			        }
					var eurl=url+"?ids="+pids;
					window.open(eurl);
				}
				break;
			case "se":
				if(com=="se1")
				{
					pids="";
					for(i=0;i<ids.length;i++)
			        {
			        	pids=pids+ids[i]+"-";
			        }
					var eurl=url+"?id="+pids;
					//alert(eurl);
					b[13].display=true;
					b[12].display="none";
					$(".reurl").val(eurl);
					$(".seturl").trigger("click");
					$(".pReload").trigger("click");
					$(".reurl").val("<?php echo ROOT_WEB_PATH; ?>/myresumefiles/ajaxinfo");
					$(".seturl").trigger("click");
				}
				if(com=="se2")
				{
					
					b[13].display=true;
					b[12].display="none";
					$(".reurl").val(url);
					$(".seturl").trigger("click");
					$(".pReload").trigger("click");
				}
				if(com=="se3")
				{
					b[12].display=true;
					b[13].display="none";
					$(".reurl").val(url);
					$(".seturl").trigger("click");
					$(".pReload").trigger("click");
				}
				
				break;
			default:
				window.open(url);
		}
	}
}
</script>
<script type="text/javascript">
var b=[{
	name:'add',
	displayname : '添加',
	tp : '<?php echo ROOT_WEB_PATH; ?>/app/webroot/css/images/icons/add.png',
	bclass : 'add',
	onpress : button,
	display:disbutton.add,
	url:addurl
},
{
	// 设置分割线
	separator : true,
	display:disbutton.del
},
{
	name:'delete',
	displayname : '删除',
	tp : '<?php echo ROOT_WEB_PATH; ?>/app/webroot/css/images/icons/delete.png',
	bclass : 'delete',
	onpress : button,
	display:disbutton.del,
	url:delurl
},
{
	// 设置分割线
	separator : true,
	display:disbutton.del
},
{
	name:'edit',
	displayname : '更新',
	tp : '<?php echo ROOT_WEB_PATH; ?>/app/webroot/css/images/icons/edit.png',
	bclass : 'add',
	onpress : button,
	display:disbutton.edit,
	url:editurl
},
{
	// 设置分割线
	separator : true,
	display:disbutton.edit
}];
</script>
<script type="text/javascript">
var ob=<?php echo $ob;?>;
if(ob.length==0)
{
	
}
else
{
	for(i=0;i<ob.length;i++)
	{
		var l=b.length;
		b[l]=ob[i];
	}
}
</script>
<?php
	echo $html->css('flexigrid');
	echo $html->css('start/jquery-ui-1.8.2.custom');
	
	//echo $javascript->link('jquery');
	echo $javascript->link('flexigrid/flexigrid'); 
	echo $javascript->link('resume');
	echo $javascript->link('department');
	//echo $javascript->link('DatePicker/WdatePicker');
	echo $javascript->link('jquery-ui-1.8.2.custom.min');
	echo $html->css ( 'style' );
	echo $html->css ( 'resume' );
?>
<script type="text/javascript">
//行业二级菜单
$(document).ready(function(){
	$("#ResumeIndustry1").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#resumesindustry").val($("#ResumeIndustry1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/industries/industriesQuery/",{
				Industry : $(this).val()
				},
			function(data,textStatus){
					 $("#ResumeIndustry2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumeIndustry2:eq(0)").append("<option></option>");
					 $("#ResumeIndustry2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
				  });
				});
		}
		else
		{
			$("#ResumeIndustry2:eq(0)>option").remove();
			$("#ResumeIndustry2:eq(0)").append("<option></option>");
			$("#ResumeIndustry2:eq(0)>option:last").val("").html("不限");
			$("#resumesindustry").val("");
		}
	});
	$("#ResumeIndustry2").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#resumesindustry").val($("#ResumeIndustry1 option:selected").text() + "_" + $("#ResumeIndustry2 option:selected").text());
		}
		else
		{
			$("#resumesindustry").val($("#ResumeIndustry1 option:selected").text() + "_");
		}
	});
});

$(document).ready(function(){
	$("#ResumeCompetency1").change(function(){
		var CompetencyDroptoplist = $(this).val();
		if(CompetencyDroptoplist!="")
		{
			$("#resumescompetency").val($("#ResumeCompetency1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/competencies/getcompetencies/",{
				Competency : $(this).val()
				},function(data,textStatus){
					 $("#ResumeCompetency2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					 $("#ResumeCompetency2:eq(0)").append("<option></option>");
					 $("#ResumeCompetency2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
					 $("#ResumeCompetency3:eq(0)>option").remove();
					 $("#ResumeCompetency3:eq(0)").append("<option></option>");
					 $("#ResumeCompetency3:eq(0)>option:last").val("").html("不限");
				  });
				});
		}
		else
		{
			$("#ResumeCompetency2:eq(0)>option").remove();
			$("#ResumeCompetency2:eq(0)").append("<option></option>");
			$("#ResumeCompetency2:eq(0)>option:last").val("").html("不限");
			$("#ResumeCompetency3:eq(0)>option").remove();
			$("#ResumeCompetency3:eq(0)").append("<option></option>");
			$("#ResumeCompetency3:eq(0)>option:last").val("").html("不限");
			$("#resumescompetency").val("");
		}
	});
});

//职能三层字段 级联菜单 //
$(document).ready(function(){
	$("#ResumeCompetency2").change(function(){
		var list = $(this).val();
		if(list!="")
		{
			$("#resumescompetency").val($("#ResumeCompetency1 option:selected").text() + "_" + $("#ResumeCompetency2 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/competencies/getcompetencies/",{
				Competency : $(this).val()
				},function(data,textStatus){
					 $("#ResumeCompetency3:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumeCompetency3:eq(0)").append("<option></option>");
					 $("#ResumeCompetency3:eq(0)>option:last").val($(this).attr("name")).html($(this).text());					 
				  });
				});
		}
		else
		{
			$("#ResumeCompetency3:eq(0)>option").remove();
			$("#ResumeCompetency3:eq(0)").append("<option></option>");
			$("#ResumeCompetency3:eq(0)>option:last").val("").html("不限");
			$("#resumescompetency").val($("#ResumeCompetency1 option:selected").text() + "_");
		}
	});
	$("#ResumeCompetency3").change(function(){
		var list = $(this).val();
		if(list!="")
		{
			if($("#ResumeCompetency1 option:selected").text()!="不限")
			$("#resumescompetency").val($("#ResumeCompetency1 option:selected").text() + "_" + $("#ResumeCompetency2 option:selected").text() + "_" + $("#ResumeCompetency3 option:selected").text());
			else
			$("#resumescompetency").val("");
		}
		else
		{
			if($("#ResumeCompetency1 option:selected").text()!="不限")
			$("#resumescompetency").val($("#ResumeCompetency1 option:selected").text() + "_" + $("#ResumeCompetency2 option:selected").text() + "_");
			else
			$("#resumescompetency").val("");
		}
	});
});

$(document).ready(function(){
	$("#ResumePosition1").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#resumesposition").val($("#ResumePosition1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/positions/getPosition/",{
				Position : $(this).val()
				},
			function(data,textStatus){
					 $("#ResumePosition2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumePosition2:eq(0)").append("<option></option>");
					 $("#ResumePosition2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
				  });
				});
		}
		else
		{
			$("#ResumePosition2:eq(0)>option").remove();
			$("#ResumePosition2:eq(0)").append("<option></option>");
			$("#ResumePosition2:eq(0)>option:last").val("").html("不限");
			$("#resumesposition").val("");
		}
	});
	$("#ResumePosition2").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#resumesposition").val($("#ResumePosition1 option:selected").text() + "_" + $("#ResumePosition2 option:selected").text());
		}
		else
		{
			$("#resumesposition").val($("#ResumePosition1 option:selected").text() + "_");
		}
	});
	$("#suitPosition1").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#suitPosition").val($("#suitPosition1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/positions/getPosition/",{
				Position : $(this).val()
				},
			function(data,textStatus){
					 $("#suitPosition2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#suitPosition2:eq(0)").append("<option></option>");
					 $("#suitPosition2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
				  });
				});
		}
		else
		{
			$("#suitPosition2:eq(0)>option").remove();
			$("#suitPosition2:eq(0)").append("<option></option>");
			$("#suitPosition2:eq(0)>option:last").val("").html("不限");
			$("#suitPosition").val("");
		}
	});
	$("#suitPosition2").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#suitPosition").val($("#suitPosition1 option:selected").text() + "_" + $("#suitPosition2 option:selected").text());
		}
		else
		{
			$("#suitPosition").val($("#suitPosition1 option:selected").text() + "_");
		}
	});
	$("#company1").change(function(){
		$("#company").val($("#company1 option:selected").val());
		
	});
});



	$(function(){
		$(".datepickerSpan :input").datepicker({
			inline: true
		});
		 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
		 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
	});
</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Resumesmanagements');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Resumesallinfo search',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<!--                                          按钮区域-->
<script type="text/javascript">
$(function(){
		$("#bt_6").click(function () {$(".bt6").click();});
		$("#bt_8").click(function () {$(".bt8").click();});
		$("#bt_10").click(function () {
			$(".bt10").click();
			$("#bt_12").hide();
			$("#bt_13").show();
			});
		$("#bt_12").click(function () {
			$(".bt12").click();
			$("#bt_12").hide();
			$("#bt_13").show();
			});
		$("#bt_13").click(function () {
			$(".bt13").click();
			$("#bt_13").hide();
			$("#bt_12").show();
			});
		$("#bt_13").click(function () {$(".bt13").click();});
		$("#bt_15").click(function () {$(".bt15").click();});
		$("#bt_17").click(function () {$(".bt17").click();});
		$("#bt_19").click(function () {$(".bt19").click();});
		});
</script>
<div class="buttonbg">
<a style="width:72px;" id="bt_6">添加到进度中</a>   <!-- 一个中文字12px宽 a的宽根据按钮内容设 -->
<a style="width:48px;" id="bt_8">删除简历</a>
<a style="width:84px;" id="bt_10">加到我的简历夹</a>
<a style="width:60px;" id="bt_12">我的简历夹</a>
<a style="width:48px; display:none;" id="bt_13">显示全部</a>

<a style="width:48px;" id="bt_15">查看简历</a>
<a style="width:48px;" id="bt_17">发给客户</a>
<a style="width:60px;" id="bt_19">发给候选人</a>             
</div>
<!--                                         按钮区域--> 

<!--                                                                           查询区域-->
                                                                       
<div class="tabflex">
<fieldset><legend><?php echo __('Resumesallinfo search')?></legend>
<?php if (count($searchitems)>0)
{
	$j=0;
	echo "<form class='searchform'>";
	echo "<ul>";
	for ($i=0;$i<count($searchitems);$i++)
	{
		echo "<li>";
		$item=$searchitems[$i];

		if ($item['type']=="text")
		{
			echo "<div class='searchitemstyle'>".$item['lable']."</div>"."<input type='text' name='".$item['name']."' class='sitems' id=".$item['id']."></input>";
		}
		elseif ($item['type']=="select")
		{
			echo "<div class='searchitemstyle'>".$item['lable']."</div>"."<select name='".$item['name']."' class='sitems' id=".$item['id'].">";
			foreach ($item['op'] as $k=>$v)
			{
				echo "<option value='$v'>$k</option>";
			}
			echo "</select>";
		}
		elseif ($item['type']=="checkbox")
		{
			echo "<input type='checkbox' name='".$item['name']."' class='sitems' id=".$item['id']. "value=".$item['value']." ></input>"."<div class='searchitemstyle'>".$item['lable']."</div>";
		}
		elseif ($item['type']=="text1")
		{
			echo "<div class='searchitemstyle'>".$item['lable']."</div>"."<input type='text' name='".$item['name']."' class='sitems' id=".$item['id']."></input>"."<div class='toitemstyle'>".$item['lable1']."</div>"."<input type='text' name='".$item['name1']."' class='sitems' id=".$item['id']."></input>";
		}
		elseif ($item['type']=="date1")
		{
			echo "<div class='searchitemstyle'>".$item['lable']."</div>"."<span class='datepickerSpan'><input type='text' name='".$item['name']."' class='sitems' id=".$item['id']."></input></span>"."<div class='toitemstyle'>".$item['lable1']."</div>"."<span class='datepickerSpan'><input type='text' name='".$item['name1']."' class='sitems' id=".$item['id1']."></input></span>";
		}
		elseif ($item['type']=="date")
		{
			echo "<div class='searchitemstyle'>".$item['lable']."</div>";?><span class="datepickerSpan"><input type='text' name="<?php echo $item['name']?>" class='sitems' id="<?php echo $item['id'];?>"/></span>
		<?php 
		}
		elseif ($item['type']=="ajax_positon")
		{
			echo "<div class='searchitemstyle' id=''>".$item['lable1']."</div>"."<select name='".$item['name1']."' class='sitems' id=".$item['id1'].">";
			foreach ($item['op1'] as $k=>$v)
			{
				echo "<option value='$v'>$k</option>";
			}
			echo "</select>";
			echo "</li><li>";
			echo "<div class='searchitemstyle' id=''>".$item['lable2']."</div>"."<select name='".$item['name2']."' class='sitems' id=".$item['id2'].">";
			foreach ($item['op2'] as $k=>$v)
			{
				echo "<option value='$v'>$k</option>";
			}
			echo "</select>";
		}
		echo "</li>";
		if ($item['br'])
		{
			echo "<br>";
		}
	}
}
echo "</ul>";
echo "<br><input type='submit' class='searchbutton' value='开始查询'/>";
echo "<input type='reset' class='resetsubmit' value='清空条件'/>";
echo "</form>";
?>
</fieldset>
</div>                                                                  
<div class="tabflex">
<table id="flex" style="display: none"></table><br></br>
</div>
<input type="hidden" class="reurl"></input>
<!--                                                                           表格-->



